home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Unix / gopher+1.2b4 / gopherd / tix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-19  |  2.0 KB  |  74 lines

  1. /********************************************************************
  2.  * lindner
  3.  * 3.1
  4.  * 1993/03/19 20:00:22
  5.  * /home/mudhoney/GopherSrc/CVS/gopher+/gopherd/tix.h,v
  6.  * Exp
  7.  *
  8.  * Paul Lindner, University of Minnesota CIS.
  9.  *
  10.  * Copyright 1991, 1992, 1993 by the Regents of the University of Minnesota
  11.  * see the file "Copyright" in the distribution for conditions of use.
  12.  *********************************************************************
  13.  * MODULE: tix.h
  14.  * Definitions and prototypes of object TIX
  15.  *********************************************************************
  16.  * Revision History:
  17.  * tix.h,v
  18.  * Revision 3.1  1993/03/19  20:00:22  lindner
  19.  * New TIX object
  20.  *
  21.  *
  22.  *********************************************************************/
  23.  
  24. #ifndef TIX_H
  25. #define TIX_H
  26.  
  27. #include "STRstring.h"
  28. #include "boolean.h"
  29. #include "DAarray.h"
  30.  
  31. struct tix_struct {
  32.      String *username;
  33.      char   password[9];  /** max of eight char password +NULL **/
  34.      long   ticket;
  35. };
  36.  
  37. typedef struct tix_struct TixObj;
  38.  
  39. #define TIXgetUser(a)    (STRget((a)->username))
  40. #define TIXsetUser(a,b)  (STRset((a)->username,(b)))
  41.  
  42. #define TIXgetPass(a)    ((a)->password)
  43. #define TIXsetPass(a,b)  (strncpy((a)->password,(b),strlen(b))) 
  44.                               /** don't copy \0, preserve spaces... **/
  45.  
  46. #define TIXgetPlainTicket(a)   ((a)->ticket)
  47. #define TIXsetPlainTicket(a,b) ((a)->ticket=b)
  48.  
  49.  
  50. TixObj *TIXnew();
  51. void    TIXdestroy();
  52. void    TIXinit();
  53. void    TIXcpy();
  54. void    TIXusedTicket();
  55. char *  TIXgetCryptedTicket();
  56. void    TIXrandomTicket();
  57. boolean TIXvalid();
  58. void    TIXtoFile();
  59.  
  60. /*** Definitions for an array of Tickets ***/
  61.  
  62. typedef DynArray TixArray;
  63. #define TIXAnew()    (ExtArray *)(DAnew(10, TIXnew,TIXinit,TIXdestroy, TIXcpy))
  64. #define TIXAdestroy(a)       (DAdestroy(a))
  65. #define TIXAgetEntry(a,b)    (TixObj*)(DAgetEntry((DynArray*)a,b))
  66. #define TIXAadd(a,b)         (DApush(a,b))
  67. #define TIXAgetNumEntries(a) (DAgetTop(a))
  68.  
  69. boolean TIXAfromFile();
  70. void    TIXAtoFile();
  71. int     TIXAsearchUser();
  72.  
  73. #endif
  74.